home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
clipper
/
nftroff.zip
/
13.tr
< prev
next >
Wrap
Text File
|
1991-11-21
|
26KB
|
1,511 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_AT2() Find position of the nth occurrence of a substring
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_AT2()
Find position of the nth occurrence of a substring
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_AT2( <cSearch>, <cTarget> [, <nOccurs> [, <lCaseSens> ] ] ) -> nPos
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cSearch>\fR is the character substring to search for\.
.sp
\fB<cTarget>\fR is the character string to search\.
.sp
\fB<nOccurs>\fR is the occurrence of cSearch to look for,
.in 1.28i
defaults to 1\.
.sp
.in 0.4i
\fB<lCaseSens>\fR is a logical value denoting case sensitivity\.
.in 1.28i
If \.F\., then search is NOT sensitive to case,
defaults to \.T\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The position of the nth occurrence of a substring
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function will find the nth occurrence of a substring
within a string\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
cSearch := "t"
.br
cTarget := "This is the day that the Lord has made\."
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget ) // Returns ( 9 )
.br
.ta
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget, 2 ) // Returns ( 17 )
.br
.ta
.sp
.ta 3.04i
.br
FT_AT2( cSearch, cTarget, 2, \.F\. ) // Returns ( 9 )
.br
.ta
.sp
.in 0.08i
\fBSource:\fR AT2\.PRG
.sp
.ta 1.84i
\fBAuthor:\fR Ralph Oliver, TRANSCOM SYSTEMS
.br
.ta
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_FINDITH()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BITCLR() Clear (reset) selected bit in a byte
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BITCLR()
Clear (reset) selected bit in a byte
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BITCLR( <cByte>, <nBitPos> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
.sp
\fB<nBitPos>\fR is a number from 0 to 7 conforming to standard
right-to-left bit numbering convention and representing the
position of the bit within the byte\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns new byte, with designated bit cleared (reset)\.
If parameters are faulty, returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
In effect, ANDs argument byte with a byte that has all bits set except
the target bit\. If bit is already clear (0), it remains clear\.
Note: Calls FT_ISBIT() which is also in this Library\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would clear bit 4 in a byte represented by CHR(115):
.sp
.in 0.56i
.br
cNewByte := FT_BITCLR( CHR(115), 4 )
.ta 2.08i
.br
? ASC( cNewbyte ) // result: 99
.br
.ta
.ta 2.08i
.br
? cNewByte // result: \'c\'
.br
.ta
.sp
.in 0.4i
This code would clear bit 5 in the byte represented by letter \'A\':
.sp
.in 0.56i
.ta 2.08i
FT_BITCLR( \'A\', 5 ) // result: \'A\', since
.br
.ta
.in 2.64i
// bit 5 already clear
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BITCLR\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BITSET()
, FT_ISBIT()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BITSET() Set selected bit in a byte
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BITSET()
Set selected bit in a byte
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BITSET( <cByte>, <nBitPos> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
.sp
\fB<nBitPos>\fR is a number from 0 to 7 conforming to standard right-to-left
bit numbering convention and representing the position of the bit
within the byte\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns new byte, with designated bit set\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
In effect, ORs argument byte with a byte that has only the target bit
set\. If bit is already set, it remains set\.
Note: Calls FT_ISBIT() which is also in this Library\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would set bit 4 in a byte represented by CHR(107):
.sp
.in 0.8i
.br
cNewbyte := FT_BITSET( CHR(107), 4 )
.ta 2.4i
.br
? ASC( cNewbyte ) // result: 123
.br
.ta
.ta 2.4i
.br
? cNewbyte // result: \'{\'
.br
.ta
.sp
.sp
.in 0.4i
This code would set bit 5 in the byte represented by the letter \'A\'\.
.sp
.in 0.8i
.ta 2.4i
? FT_BITSET( \'A\', 5 ) // result: \'a\'
.br
.ta
.in 3.2i
// bit 5 set
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BITSET\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BITCLR()
, FT_ISBIT()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTEAND() Perform bit-wise AND on two ASCII characters (bytes)
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTEAND()
Perform bit-wise AND on two ASCII characters (bytes)
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTEAND( <cByte1>, <cByte2> ) -> cByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte1>\fR and \fB<cByte2>\fR are characters from CHR(0) TO CHR(255)\.
May be passed in CHR() form, as character literals, or as expressions
evaluating to CHR() values\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for any bit-wise masking operation\. In effect, this is a
bit-by-bit AND operation\. Equivalent to AND assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code would mask out the high nibble (four most significant bits)
of the byte represented by chr(123) and leave the low nibble bits as in
the parameter byte\.
.sp
.in 0.8i
.br
cNewbyte := FT_BYTEAND( CHR(123), CHR(15) )
.ta 1.36i
.br
? asc(cNewByte) // result: 11
.br
.ta
.ta 1.36i
.br
? cNewByte // result: non-printable character
.br
.ta
.sp
.in 0.4i
For a demonstration of Clipper bit manipulations, compile and
link the program BITTEST\.PRG in the Nanforum Toolkit source code\.
.sp
.in 0.08i
\fBSource:\fR BYTEAND\.PRG
.sp
\fBAuthor:\fR Forest Belt, Computer Diagnostic Services, Inc\.
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_BYTEOR()
, FT_BYTEXOR()
, FT_BYTENOT()
, FT_BYTENEG()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_BYTENEG() Perform bit-wise negation on an ASCII character
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_BYTENEG()
Perform bit-wise negation on an ASCII character
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_BYTENEG( <cByte> ) -> cNewByte
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<cByte>\fR is a character from CHR(0) to CHR(255)\.
May be passed in CHR() form, as character literal, or
as expression evaluating to CHR() value\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
Returns resulting byte, in CHR() form\. If parameters are faulty,
returns NIL\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Can be used for bit-wise byte manipulation\. In effect, this is a
bit-by-bit NEG (two\'s complement) operation\. Equivalent to NEG
assembler instruction\.
.sp
This function is presented to illustrate that bit-wise operations
are possible with Clipper code\. For greater speed, write \.C or
\.ASM versions and use the Clipper Extend system\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
This code performs a bit-wise NEG on byte represented by CHR(32):
.sp
.in 0.8i
.br
cNewByte := FT